package com.modelo.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
 
@Entity
@Table(name = "obra_proveedor", catalog = "firmes")
public class ObraProveedor implements java.io.Serializable {
 
	private static final long serialVersionUID = 1L;
	
	private Integer idObraProveedor;
	private Proveedor proveedor;
	private Obra obra;

	
	public ObraProveedor() {
	}
 
	public ObraProveedor(Integer idObraProveedor, Proveedor proveedor, Obra obra) {
		this.idObraProveedor = idObraProveedor;
		this.proveedor = proveedor;
		this.obra = obra;
	}
 
	@Id
	@GeneratedValue
	@Column(name = "idObraProveedor", unique = true, nullable = false)
	public Integer getIdObraProveedor() {
		return this.idObraProveedor;
	}

	public void setIdObraProveedor(Integer idObraProveedor) {
		this.idObraProveedor = idObraProveedor;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idProveedor", nullable = false)
	public Proveedor getProveedor() {
		return this.proveedor;
	}

	public void setProveedor(Proveedor proveedor) {
		this.proveedor = proveedor;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idObra", nullable = false)
	public Obra getObra() {
		return this.obra;
	}

	public void setObra(Obra obra) {
		this.obra = obra;
	}

}